$(function () {
    wowInt();

    wowDelay(".yj_list",$('.yj_list .term_box').length,"0.3");
    // wowDelayPlus(".culture_list ul",'.culture_list .li',"0.2");
    wowDelay(".culture_box",$('.culture_box .culture_item').length,"0.1");
    // wowDelay(".lx_two_list ul",$('.lx_two_list ul li').length,"0.2");
    // wowDelay(".yx_three_list ul",$('.yx_three_list ul li').length,"0.2");


    $(function () {
    new WOW().init();
})

// top
var wh=$(window).height()
var ww=$(window).width()
 $(".back_top").click(function(){
        $("html,body").stop().animate({scrollTop: 0}, 800);
    });

    $(window).scroll(function(){
        if($(window).scrollTop() < wh){
            $(".back_top").hide();
        }else{
            $(".back_top").show();
        }
    
    });

})



function wowInt(){
    if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
        var wow = new WOW({
            boxClass: 'wow',
            animateClass: 'animated',
            offset: 100,
            mobile: true,
            live: true
        });
        wow.init();
    };
}

function wowDelay(box,row,delayTime){
    $(box).children().each(function(index){
        for(var i = 0;i<row;i++){
            if(index%row==i){
                $(this).attr("data-wow-delay",i*delayTime+'s');
            };
        };
    });
};

function wowDelayPlus(box,item,delayTime){
    if(document.querySelectorAll(item).length === 0) return;
    var box_width = getStyle(document.querySelectorAll(box)[0], 'width');
    var item_width = getStyle(document.querySelectorAll(item)[0], 'width');
    var row = document.querySelectorAll(item).length;
    var len = Math.floor(Math.floor(parseFloat(box_width))/Math.floor(parseFloat(item_width)));
    $(box).children().each(function(index){
        let time = index%len*0.4;
        for(var i = 0;i<row;i++){
            if(index%row==i){
                $(this).attr("data-wow-delay",time+'s');
            };
        };
    });
};